#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <queue>
#include <algorithm>
#define REP(i,n) for(int i=0;i<int(n);++i)
#define PB(X) push_back(X)
using namespace std;

vector<int> v[220];

bool equal(int a,int b)
{
	if(v[a].size()!=v[b].size()) return false;
	REP(i,v[a].size()) if(v[a][i]!=v[b][i]) return false;
	return true;
}
int main()
{
	int n;
	cin>>n;
	if(n==2)
	{
		int k,t;
		cin>>k;
		REP(i,k)
		{
			cin>>t;
			if(!i) printf("1 %d\n%d",t,k-1);
			else printf(" %d",t);
		}
		cout<<endl;
		return 0;
	}
	REP(i,n*(n-1)/2)
	{
		int k;
		scanf("%d",&k);
		REP(j,k)
		{
			int t;
			scanf("%d",&t);
			v[t].PB(i);
		}
	}
	REP(i,201) if(!v[i].empty())
	{
		//printf("!%d\n",i);
		vector<int> ans;
		ans.PB(i);
		for(int j=i+1;j<=200;j++) if(equal(i,j))
		{
			//printf("eq %d : %d\n",i,j);
			ans.PB(j);
			v[j].clear();
		}
		cout<<ans.size();
		REP(j,ans.size()) cout<<" "<<ans[j];
		cout<<endl;
	}
	return 0;
}
